package com.Lab427.workflow.common.config;

import org.springframework.ai.chat.client.ChatClient;
import org.springframework.ai.chat.client.advisor.MessageChatMemoryAdvisor;
import org.springframework.ai.chat.client.advisor.SimpleLoggerAdvisor;
import org.springframework.ai.chat.memory.ChatMemory;
import org.springframework.ai.chat.prompt.ChatOptions;
import org.springframework.ai.openai.OpenAiChatModel;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * @version 1.0
 * @auther Tian Yunhe
 */
@Configuration
public class CommonConfiguration {
    @Bean
    public ChatClient chatClient(OpenAiChatModel model){
        return ChatClient.builder(model)
                .defaultSystem("你是数据分析的智能助手，你将以科学的角度对数据进行分析，不要对数据进行编造，要确保数据的真实性。")
                .defaultAdvisors(
                        new SimpleLoggerAdvisor()
                )
                .build();
    }
}
